package prototype;

import prototype.framework.Product;

public class UnderlinePen implements Product {
    private char underLineChar;

    public UnderlinePen(char underLineChar) {
        this.underLineChar = underLineChar;
    }

    @Override
    public void use(String s) {
        int length = s.getBytes().length;
        System.out.println("\"" + s + "\"");

        for (int i = 0; i < length; i++) {
            System.out.print(underLineChar);
        }
        System.out.println();
    }

    @Override
    public Product createClone() {
        Product p = null;
        try {
            p = (Product) clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return p;
    }
}
